package com.grq.mis.exception;

public class BusinessException extends RuntimeException{

    private int code;
    private String msg;

    public BusinessException(String msg) {
        this.msg = msg;
    }

    public BusinessException(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public BusinessException(ResultEnum result) {
        this.code = result.getCode();
        this.msg = result.getMsg();
    }

    public BusinessException(ResultEnum result, String msg) {
        this.code = result.getCode();
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public String errorMsg() {
        return msg + "(" + code + ")";
    }
}
